<!DOCTYPE html>
<html>
<head>
<title>Daftar Testimoni</title>
<link href="View/bootstrap/css/bootstrap.css" rel="stylesheet">
<link href="View/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
<link  href="View/bootstrap/js/bootstrap.min.js" rel="stylesheet"/>
<script type="text/javascript" src="View/bootstrap/js/jquery-latest.js"></script>
</head>
<?php
include_once '../model/contactus.php';
session_start();
if (!isset($_SESSION["id_user"])){
	include '/content/content_header_guest.php';
} else {
	include '/content/content_header_user.php';
}
?>
<body> 
<h3>Daftar Contact </h3>  
	<div class="container-fluid">
		<div class="row-fluid">
			<div class="span9">
			<a href="form_contact_us.php" class="pull-right" >+Tambah</a>
				<table class="table table-hover">
					<th>Nama</th>
					<th>Email</th>
					<th>Judul</th>
					<th>Isi</th>
					<th>&nbsp;</th>
					<?php 
					$contact = new ModelContactUs();
					if (isset($_GET['delete'])) {
						$contact -> deleteContactUs($_GET['delete']);
					}
					$contactus = $contact-> getContactUs();
					
					if (!empty($contactus))
					{
						foreach ($contactus as $id_contactus => $contactus)
						{
							echo 
							'<tr>
								<td>'.$contactus->namapengirim.'</td>
								<td>'.$contactus->emailpengirim.'</td>
								<td>'.$contactus->judulcontactus.'</td>									
								<td>'.$contactus->isicontactus.'</td>
								<td><a href="list_contact_us.php?delete='.$contactus->id_contactus.'"><i class="icon-trash"></a></td>
							</tr>';
						}
					} else {
							echo 
								'<tr>
									<td>contact us kosong</td>
								</tr>';
						}
					?>
				</table>
			</div>
			<div class="span3">
				<?php 
					include '/content/content_mini_list_produk.php';
				?>
				<?php
					include '/content/content_banner.php';
				?>
			</div>
		</div>
    </div>
</body>
<?php
include '/content/content_footer_site_map.php';
include '/content/content_footer.php';
?>